<% if @gems.any? %>

  


  <div id="alpha_index"><%= ("a".."z").map{|i| @index_gems.include?(i) ? "<a href='#jump_#{i}'>#{i}</a>" : i }.join(" - ") %></div>

  <ul class="gemlist">

    <% @gems.each do |name, versions| %>
      <li <%= %{id="jump_#{name[0..0]}"} if @index_gems.delete(name[0..0]) %>>
        <h2 class="trigger"><%= name %> &nbsp; <span class="version_number">[ <%= versions.size == 1 ? versions.first : "#{versions.last}" %> ]</span> <%= ' *' if versions.count > 1 %></h2>
		<div class="extra_info hidden">
			<% versions.each do |version| %>

	          <form class="delete-form" method="post" action="/gems/<%= name %>-<%= version %>.gem">

	            <code>gem install <%= name %> <%= "--prerelease" if version.to_s.match(/[a-z]/i) %> -v "<%= version %>"</code>

	            <input type="hidden" name="_method" value="DELETE" />
	            <button type="submit"> X </button>
	          </form>
	        <% end %>

	        <div class="details">
	          <p>
	            <% if spec = spec_for(name, versions.last) %>
	              <%= spec.description %> ... by: <a href='<%= spec.homepage %>'><%= spec.author %></a>
	            <% end %>
	          </p>
	        </div>
			
		</div>
        
      </li>
    <% end %>
  </ul>
<% end %>


